#pragma once
#include "agentstate.h"
#include "KalmanTank.h"

#define DANGER_THRESHOLD (M_PI / 4.0f)

#define LEFT -1
#define RIGHT 1

class EvadeState :
	public AgentState
{
public:
	EvadeState();
	EvadeState(KalmanTank* enemy, int direction);
	~EvadeState(void);

	Command GetCommand(Agent* agent);

private:
	Vector2 CalcEvadeTrajectory(Vector2 pos);
	bool InDanger(Vector2 pos);
	float NormalizeAngle(float angle);

	KalmanTank* enemy;
	int direction;
};

